#ifndef MAINWINDOW_H
#define MAINWINDOW_H

class MainWindow;

template <int n> class Learner;
const int N = 2;

#include <QMainWindow>
#include <QFileDialog>
#include <QMessageBox>
#include <QDesktopServices>
#include <QVBoxLayout>
#include "simulator.h"

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    friend class Learner<N>;
    explicit MainWindow(QWidget *parent = 0);
    void readInput();
    ~MainWindow();

public slots:
    void launch();
    void ontab(int);
    void reinitializeSimu();
    void learnFinished();

    //Slots for the parameters
    //Naming convention:
    // - p, m or s (physical, motor or sensor parameters)
    // - b or s (box or slider)
    // - 1,2,3 or 4 (id of the system in the comboBox, 1 if it's common between all)
    // - 1,2,3,4,5 or 6 (row in the parameter block)

    void pb11(double);
    void ps11(int);
    void pb12(double);
    void ps12(int);
    void pb13(double);
    void ps13(int);

    void pb21(double);
    void ps21(int);
    void pb22(double);
    void ps22(int);

    void pb31(double);
    void ps31(int);
    void pb32(double);
    void ps32(int);
    void pb33(double);
    void ps33(int);
    void pb34(double);
    void ps34(int);
    void pb35(double);
    void ps35(int);
    void pb36(double);
    void ps36(int);

    void pb41(double);
    void ps41(int);
    void pb42(double);
    void ps42(int);
    void pb43(double);
    void ps43(int);
    void pb44(double);
    void ps44(int);
    void pb45(double);
    void ps45(int);

    void mb12(double);
    void ms12(int);
    void mb13(double);
    void ms13(int);
    void mb14(double);
    void ms14(int);

    void sb12(double);
    void ss12(int);
    
private:
    Learner<N> *learner;
    Simulator<N> *sim;
    void connectAll();
    QString filename;
    int tab, type;
    QList<double> physParameters, motParameters, senParameters;
    Ui::MainWindow *ui;
};



#include "learner.h"

#endif // MAINWINDOW_H
